<template>

    <div>
        <h1>情况一：监视【ref】定义的【基本类型】数据</h1>
        用户id: <input type="text" v-model="id">
        根据{{ id }} 查询列表...
    </div>



</template>

<script setup lang="ts" name='Watch1'>
import { ref, reactive, watch } from "vue";

let id = ref(1);


//观察的基础数据
watch(id, function (newVal, oldValue) {

    console.log("newVal", newVal);
    console.log("oldValue", oldValue);

    console.log("根据当前最新的id 查询数据");

})





</script>






<style scoped></style>